<!--
 * @Description: 
 * @Author: wangqi
 * @Date: 2021-05-04 22:40:41
 * @LastEditTime: 2021-05-08 10:43:33
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h3>哈哈哈哈</h3>
    <div id="wrap"></div>
</body>
<script src="./bundle.js"></script>

<script>
    let titleTmp = `<p>来自{{sname}}, &emsp;&emsp; 介绍：{{title}}, 和你们说： {{tmp.a.b}} 分, 他们：{{tmp.f.g}}</p>`;
    let titleTmp1 = `<ul class="sname">
                        {{#liData}}
                            <li>
                                {{sname}} 的年龄：{{sage}},
                                爱好是: {{#hobbies}}  <span>{{.}},</span>  {{/hobbies}}
                            </li>
                        {{/liData}}
                    </ul>`;
    let obj = {
        sname: "小花",
        title: "嘻嘻嘻",
        tmp: {
            a: {
                b: 100
            },
            f: {
                g: 200
            }
        }
    };
    let obj1 = {
        liData: [{
            sname: "小明",
            sage: "11",
            hobbies: ["唱歌", "跳舞", "打篮球"],
        }, {
            sname: "小明1",
            sage: "112",
            hobbies: ["唱歌2", "跳舞2", "打篮2球"],
        }],
    };


    let domStr = WQ_TemplateEngine.render(titleTmp1, obj1);
    let wrap = document.querySelector("#wrap");
    wrap.innerHTML = domStr;
</script>

</html>